import Vue from "vue";
import VueRouter from "vue-router";

// 引入组件
import PostBuild from "./components/PostBuild";
import PostSuccess from "./components/PostSuccess";
import PartsList from "./components/PartsList";
import ShareFPV from "./components/ShareFPV";
import Home from "./components/Home";
import PartsDetail from "./components/PartsDetail";

// 管理员界面
import UserPostEdit from "./admin/UserPostEdit";
import UserPostList from "./admin/UserPostList";
import Index from "./admin/index";
import AddPart from "./admin/addpart";

// vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
  {
    path:"/",
    component: Home
  },
  {
    path:"/post-build",
    component: PostBuild
  },
  {
    path:"/post-success",
    component: PostSuccess
  },
  {
    path:"/parts-list",
    component: PartsList
  },
  {
    path:"/share-fpv",
    component: ShareFPV
  },
  {
    path:"/parts-detail",
    component: PartsDetail
  },




  {
    path:"/admin/index",
    component: Index
  },
  {
    path:"/admin/userpostedit",
    component: UserPostEdit
  },
  {
    path:"/admin/userpostlist",
    component: UserPostList
  },
  {
    path:"/admin/addpart",
    component: AddPart
  }
]

var router =  new VueRouter({
  mode: 'history',
  routes
})
export default router;
